package dfbz.com.service.impl;

import dfbz.com.dao.UserInfoDao;
import dfbz.com.model.UserInfo;
import dfbz.com.service.UserInfoService;

import java.util.List;
import java.util.Map;

public class UserInfoServiceImpl implements UserInfoService {
    private UserInfoDao userInfoDao=new UserInfoDao();

    @Override
    public List<Map<String, Object>> findList(Integer userId,int page) {
        List<Map<String, Object>> list = userInfoDao.findList(userId,page);
        for (Map<String,Object> map : list) {
            if(null == map.get("realName")){
                map.put("realName",map.get("username"));
            }
        }
        return list;
    }


    @Override
    public List<UserInfo> findUserInfo() {
        return userInfoDao.findAll(UserInfo.class) ;
    }


}
